<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
  <title>Title</title>
</head>
<body>
<%
  //使用pageContext设置属性，该属性默认在page范围内
  pageContext.setAttribute("pageContext","pageContext");

  //使用request设置属性，该属性默认在request范围内
  request.setAttribute("request","request");

  //使用session将属性设置在session范围内
  session.setAttribute("session","session");

  //使用application将属性设置在application范围内
  application.setAttribute("application","application");
%>
<%--<jsp:forward page="aaa.jsp"></jsp:forward>--%>
<%  response.sendRedirect("http://localhost:8080/demo4_war/aaa.jsp"); %>
<table>
  <tr>
    <td>pageContext值:</td>
    <td><%= pageContext.getAttribute("pageContext")%></td>
  </tr>
  <tr>
    <td>request值:</td>
    <td><%= request.getAttribute("request")%></td>
  </tr>
  <tr>
    <td>session值:</td>
    <td><%= session.getAttribute("session")%></td>
  </tr>
  <tr>
    <td>application值:</td>
    <td><%= application.getAttribute("application")%></td>
  </tr>
</table>

</body>
</html>